			// from our helper library
			IntPtr token;
			bool result = LogonUser(
				User, "WOODGROVE", "P@ssw0rd",
				LogonTypes.Interactive,
				LogonProviders.Default,
				out token);
			if (result) {
				WindowsIdentity id = new WindowsIdentity(token);
			WindowsPrincipal p = new WindowsPrincipal(id);
			CloseHandle(token);

			System.Threading.Thread.CurrentPrincipal = p;

			// use IPrincipal/IIdentity to query the token
			Console.WriteLine("{0} is a User: {1}", id.Name,
				p.IsInRole(WindowsBuiltInRole.User));
			Console.WriteLine("{0} is a User: {1}", System.Threading.Thread.CurrentPrincipal.Identity.Name,
				p.IsInRole(WindowsBuiltInRole.User));
			Console.WriteLine("{0} is an Admin: {1}", id.Name,
				p.IsInRole(WindowsBuiltInRole.Administrator));
			}
			else {
			Console.WriteLine("LogonUser failed: {0}",
				Marshal.GetLastWin32Error());
			}






////			item.Assignedto = "GABBIPM";

			//foreach (Field field in item.Fields)
			//{
			//    Console.WriteLine(field.Name);
			//}

			////  Let's make sure all fields are valid before saving
			//ArrayList invalidFields = new ArrayList();

			//foreach (Field field in item.Fields)
			//{
			//    if (!field.IsValid)
			//    {
			//        invalidFields.Add(field);
			//        Console.WriteLine("Invalid Field '{0}': {1}", field.Name, field.Status.ToString());
			//        Console.WriteLine("Current Value: '{0}'", field.Value);
			//        Console.WriteLine();
			//    }
			//}

			//if (invalidFields.Count == 0)
			//{
			//    item.Save();
			//    Console.WriteLine("Work Item #{0} Successfully Created.", item.Id);
			//}

			//// transition the work item to the next state (given an action)
			//string nextState = workItem.GetNextState("Microsoft.VSTS.Actions.Checkin");
			//workItem.State = nextState;
			//workItem.Title = String.Format("Transitioning SDK work item to {0}", nextState);

			//workItem.Save();
			//Console.WriteLine("Work Item #{0} Successfully Transitioned to {1}.", workItem.Id, nextState);







		[DllImport("advapi32.dll", SetLastError = true)]
		static extern bool LogonUser(
		  string principal,
		  string authority,
		  string password,
		  LogonTypes logonType,
		  LogonProviders logonProvider,
		  out IntPtr token);
		
		[DllImport("kernel32.dll", SetLastError = true)]
		static extern bool CloseHandle(IntPtr handle);
		enum LogonTypes : uint
		{
			Interactive = 2,
			Network,
			Batch,
			Service,
			NetworkCleartext = 8,
			NewCredentials
		}
		
		enum LogonProviders : uint
		{
			Default = 0, // default for platform (use this!)
			WinNT35,     // sends smoke signals to authority
			WinNT40,     // uses NTLM
			WinNT50      // negotiates Kerb or NTLM
		}